Support custom httpx client creation#752
Conversation
# Conflicts: # src/mcp/client/sse.py # src/mcp/client/streamable_http.py
ihrpr
left a comment
There was a problem hiding this comment.
Thank you! Would be great to add instruction to README as well
|
It would have been better to pass the client itself... |
Agree with this |
|
A new unit test would have been nice too. |
|
And now I notice that the |
it's not in sse, but in general is there, am I missing something? |
Ah, I missed that, sorry. That said, on the sse, we use the client, so you can actually pass the timeout to the client before using the |
yes, we should, I can just add this as there were a couple of PRs and issues about it |
Motivation and Context
Currently the SDK defaults imply certain properties for httpx clients, two notable ones are redirect policies as well as proxies. To support various security configurations instead make the client wholly injectable. This avoids clients needing to fork the entire transport method.
How Has This Been Tested?
Tested locally with a fake client.
Breaking Changes
None.
Types of changes
Checklist
Additional context
N/A